Page({
  data: {
    num: 0,
    contentw: '杭州市全城',
    message: [
      {
        id: '0',
        text: "杭州市",
        textList:
        {
          name: '余杭',
          address: '上成'
        }
      },
      {
        id: '1',
        text: '杭州市',
        textList:
          {
              name: '余杭',
              address: '上成'
            },
  
      
        add:'大雨'
      },
      {
        id: '2',
        text: '大鱼号',
        textList:
        {
          name: '余杭',
          address: '上成'
        },
        add: '大雨'
      },
      {
        id: '3',
        text: '杭州市',
        textList:
        {
          name: '余杭',
          address: '上成'
        },
      }, {
        id: '4',
        text: '大鱼号',
        textList:
        {
          name: '余杭',
          address: '上成'
        }
      }
    ],
    text1: '全部',
    nav_list: ['杭州市', '上海市', '北京市', '武汉市','成都市','南京市'],
    opens: false,
    open: false,
    array:[{
      picList: 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640',
      addressName: '武林广场',
      address:'浙江商州市xx楼'
      },{
        picList: 'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640',
         addressName: '凤凰广场',
        address: '浙江商州市xx楼'
    }, {
        picList: 'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640',
        addressName: '武林广场',
        address: '浙江商州市xx楼'
    }],
    advImage:[
      'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640',
      'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640',
      'https://images.unsplash.com/photo-1551446591-142875a901a1?w=640'
    ],
    currentSwiper: 0,
    indicatorColor: 'white',
    indicatorActivecolor: 'red'

  },
  onLoad: function (options) {
    this.setData({
      advimg: this.data.advImage,
    })
  },
  onShow: function () {

  },
  swiperChange: function (e) {
    this.setData({
      currentSwiper: e.detail.current
    })
  },

  clickList: function (e) {
    console.log(e)
    let num = e.target.id
    console.log(num)
    let content = this.data.message[num].textList
    let contents = this.data.message[num].add
    console.log(77, content)
    this.setData({
      num: num,
      content: content,
 
      text: content
    })
   
    console.log(88, content)
  },

  off_canvas: function () {
    this.data.open ?
      this.setData({ open: false })
      : this.setData({ open: true });
  },
  off_canvas1: function () {
    this.data.opens ?
      this.setData({ opens: false })
      : this.setData({ opens: true });
  },
  //列表的操作函数
  open_list: function (opts) {
    this.setData({
      text1: opts.currentTarget.dataset.title,
      open: false
    });
  },
  content1: function(e) {
   this.setData({
     contentw: e.currentTarget.dataset.title.name,
     opens: false
    })
     console.log(88, e)
  },
  content2: function (e) {
    console.log(88,e )
    this.setData({
      contentw: e.currentTarget.dataset.title.address,
      opens: false
    })
  },
  scrollLower: function () {
   wx.showToast({
     title: '没有了',
     icon:'success',
     duration:300
   })
  }
})